package cn.sccl.common.model;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Observable;

/**
 * Created by 杨浩宇 on 2016-02-17.
 */
public class BaseModel extends Observable implements Serializable {
    protected String id;

    /**
     * 创建时间
     */
    protected Timestamp createTime;
    /**
     * 更新时间
     */
    protected Timestamp updateTime;
    /**
     * 删除标识
     */
    protected boolean deleteFlag = false;
    /**
     * 年份
     */
    protected Integer year;
    /**
     * 省份编码
     */
    protected String provinceCode;

    private Page page;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public boolean isDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(boolean deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public Page getPage() {
        return page;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    @Override
    public synchronized void setChanged() {
        super.setChanged();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof BaseModel)) return false;

        BaseModel baseModel = (BaseModel) o;

        return getId().equals(baseModel.getId());
    }

    @Override
    public int hashCode() {
        return getId().hashCode();
    }
}
